 <template>
    <div class="ad-wrapper">
        <div class="title-box">
            <p class="title-01">正美集团 还美医疗整形</p>
            <p class="title-02">用实力和信誉铸就品牌</p>
            <p class="title-03 enUppercase">HM Medical Plastic Surgery</p>
        </div>

        <div class="carousel-box">
            <el-carousel height="3.38rem" style="width:100%; text-align:center;">
                <el-carousel-item v-for="item in banners" :key="item.id">
                    <a :href="item.href">
                        <img :src="constant.api_url + item.picture" :alt="item.title">
                    </a>
                </el-carousel-item>
            </el-carousel>

            <!-- <el-carousel :interval="4000" type="card" height="200px">
    <el-carousel-item v-for="item in 6" :key="item">
      <h3>{{ item }}</h3>
    </el-carousel-item>
            </el-carousel>-->
        </div>
    </div>
</template>

  <script type="text/ecmascript-6">
import constant from "@/utils/constant.js";
// 引用API文件
import http from "@/utils/http.js";
export default {
  name: "ad",
  data() {
    return {
      banners: [

      ],
      constant: constant
    };
  },
  components: {},
  created() {
    http.get(this, {
      url: "index/bannerlist",
      data:{
          type: 17
      },
      dataType: "json",
      success: function(data) {
        console.log('ad:', data);
        if (data.status == 1) {
          this.banners = data.info;
        }
      }
    });
  }
};
</script>

 <style scoped lang="scss">
.ad-wrapper {
  background-color: $c-white-light;
  padding: 0.42rem 0.2rem 0.21rem 0.2rem;
  @extend .cmm-border;

  .title-box {
    p {
      text-align: center;
    }
    .title-01 {
      font-size: 0.22rem;
      line-height: 0.3rem;
      color: $c-mainC;
    }

    .title-02 {
      font-size: 0.32rem;
      color: $c-themeC;
      line-height: 0.3rem;
        margin:0.12rem 0;
    }

    .title-03 {
      @extend .en;
      font-size: 0.14rem;
      color: $c-gray-light;
      line-height: 0.3rem;
    }
  }
}
</style>
